home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 003 / motorola / DOS / ASEMBLER_DOC < prev    next >
Text File  |  1990-12-24  |  14KB  |  332 lines

  1. .XT:0
  2. .XB:0
  3.  
  4.  
  5.  
  6.                    The IBM PC 6800/01/04/05/09/11 cross assemblers
  7.  
  8.  
  9.           GENERAL                                                          
  10.                   The assemblers are named as*.exe where '*' is any of 0,
  11.                   1, h1, 4, 5, HC5, 9, or 11 depending on which one you're
  12.                   using.  Command line arguments specify the filenames to
  13.                   assemble.
  14.  
  15.                   The assemblers accept options from the command line to be
  16.                   included in the assembly.  These options are the
  17.                   following:
  18.  
  19.                           l      enable output listing.
  20.                           nol    disable output listing (default).
  21.                           cre    generate cross reference table.
  22.                           s      generate a symbol table.
  23.                           c      enable cycle count.
  24.                           noc    disable cycle count.
  25.  
  26.                   The command line looks like this :
  27.  
  28.                           as* file1 file2 ... [ - option1 option2 ...]
  29.  
  30.                   If this method of passing commands to the assembler is
  31.                   used rather than the OPT pseudo op code, a space should
  32.                   separate the minus sign from the last file name and the
  33.                   first option.  Example:
  34.  
  35.                           as5 program - l cre
  36.  
  37.                   This command assembles file 'program' with an output
  38.                   listing and a cross reference table.
  39.  
  40.                   The `S1' formatted object file is placed in file
  41.                   `filename.S19' (m.out on older versions).  The listing
  42.                   and error messages are written to the standard output.
  43.                   If multiple files are assembled, the 'S1' file will be
  44.                   placed under the first file's name.S19.
  45.  
  46.                   The listing file contains the address and bytes assembled
  47.                   for each line of input followed by the original input
  48.                   line (unchanged, but moved over to the right some).  If
  49.                   an input line causes more than 6 bytes to be output (e.g.
  50.                   a long FCC directive), additional bytes (up to 64) are
  51.                   listed on succeding lines with no address preceding them.
  52.  
  53.                   Equates cause the value of the expression to replace the
  54.                   address field in the listing.
  55.  
  56.                   Equates that have forward references cause Phasing Errors
  57.                   in Pass 2.
  58.  
  59.                   Expressions may consist of symbols, constants or the
  60.                   character '*' (denoting the current value of the program
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.                   counter) joined together by one of the operators: +-
  73.                   */%&|^.  The operators are the same as in C:
  74.  
  75.                           +      add
  76.                           -      subtract
  77.                           *      multiply
  78.                           /      divide
  79.                           %      remainder after division
  80.                           &      bitwise and
  81.                           |      bitwise or
  82.                           ^      bitwise exclusive-or
  83.  
  84.                   Expressions are evaluated left to right and there is no
  85.                   provision for parenthesized expressions.  Arithmetic is
  86.                   carried out in signed twos-complement integer precision
  87.                   (16 bits on the IBM PC)
  88.  
  89.                   Constants are constructed with the same syntax as the
  90.                   Motorola MDOS assembler:
  91.  
  92.                           '      followed by ASCII character
  93.                           $      followed by hexadecimal constant
  94.                           @      followed by octal constant
  95.                           %      followed by binary constant
  96.                           digit  decimal constant
  97.  
  98.  
  99.           ERRORS
  100.                   Error diagnostics are placed in the listing file just
  101.                   before the line containing the error.  Format of the
  102.                   error line is:
  103.  
  104.                      File_name,Line_number: Error -> Description of error
  105.                                  or
  106.                      File_name,Line_number: Warning --- Description of error
  107.  
  108.                   Errors of the first type in pass one cause cancellation
  109.                   of pass two.  Warnings do not cause cancellation of pass
  110.                   two but should cause you to wonder where they came from.
  111.  
  112.                   Error messages are meant to be self-explanatory.
  113.  
  114.                   Finally, some errors are classed as fatal and cause an
  115.                   immediate termination of the assembly.  Generally these
  116.                   errors occur when a temporary file cannot be created or
  117.                   is lost during the assembly. Consult your local guru if
  118.                   this happens.
  119.  
  120.  
  121.           DIFFERENCES
  122.  
  123.                   For indexed addressing, the comma is required before the
  124.                   register; `inc x' and `inc ,x' are not the same.
  125.  
  126.                   Macros are not supported.  (try M4 or M6)
  127.  
  128.                   The force size operators ('>' and '<') are implemented
  129.                   for all assemblers.
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.                   The only pseudo-ops supported are:
  139.  
  140.                           ORG, FCC, FDB, FCB, EQU, RMB, BSZ, ZMB, FILL,
  141.                           PAGE, END, and OPT.
  142.  
  143.                   The OPT pseudo-op allows the following operands:
  144.  
  145.                           nol     Turn off output listing
  146.                           l       Turn on output listing (default)
  147.                           noc     Disable cycle counts in listing (default)
  148.                           c       Enable cycle counts in listing (clear
  149.                                      total cycles)
  150.                           contc   Re-enable cycle counts (don't clear total
  151.                                      cycles)
  152.                           cre     Enable printing of a cross reference
  153.                                      table
  154.                           s       generate a symbol table
  155.  
  156.                   Some of the more common pseudo-ops are not present:
  157.  
  158.                           SPC     Use blank lines instead
  159.                           TTL     use `pr' to get headings and page numbers
  160.                           NAM[E]  Did you ever use this one anyway?
  161.  
  162.                           The above pseudo-ops are recognized, but ignored.
  163.  
  164.                   ZMB (Zero Memory Bytes) is equivalent to BSZ (Block Store
  165.                   Zeroes). FILL can be used to initialize memory to
  166.                   something other than zero:
  167.                           FILL val,nbytes.
  168.  
  169.           TARGET MACHINE SPECIFICS
  170.  
  171.            (as0) 6800:  Use for 6802 and 6808 too.
  172.  
  173.            (as1) 6801:  You could use this one for the 6800 and avoid LSRD,
  174.                         ASLD, PULX, ABX, PSHX, MUL, SUBD, ADDD, LDD and
  175.                         STD.
  176.  
  177.                  6301:  Called ash1 (Hitachi 6801).  Same as 6801 except
  178.                         cycle times are reduced and a few new instructions
  179.                         are added: XGDX, SLP, AIM, OIM, EIM, TIM.
  180.                         Convenience mnemonics BSET, BCLR, BTGL, BCHG and
  181.                         BTST are also present which generate appropriate
  182.                         mask values:
  183.  
  184.                                   BSET 4,dog --> OIM #10,dog
  185.  
  186.                         Bit manipulation using indexed addressing is
  187.                         specified with a trailing ",x": aim #mask,index,x
  188.                         or btgl 5,index,x.
  189.  
  190.            (as4) 6804:  The symbols 'a', 'x' and 'y' are predefined as $FF,
  191.                         $80 and $81 respectively.  Also defined as 'A', 'X'
  192.                         and 'Y'.  Because of the 6804 architecture, this
  193.                         means that 'clr x' will work since the x register
  194.                         is just a memory location. To use short-direct
  195.                         addressing, the symbol involved must not be a
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.                         forward reference (i.e. undefined) and must be in
  205.                         the range $80-$83.
  206.  
  207.                         Remember that bytes assembled in the range $10-$7F
  208.                         will go into the data space; There is no program
  209.                         space ROM for these locations.
  210.  
  211.                         The syntax for Register indirect addressing is as
  212.                         follows:
  213.                                   mnemonic [<x>or<y>]
  214.                         an example is:
  215.                                   lda [x]
  216.  
  217.                         The MVI instruction (move immediate) has its own
  218.                         format :
  219.                                   mvi address,#data
  220.                         where address is an 8-bit address in page zero,
  221.                         and data is the value to be written to specified
  222.                         location.
  223.  
  224.            (as5) 6805:  There is no 'opt cmos' pseudo, so be careful not to
  225.                         use STOP or WAIT in a program that is destined for
  226.                         an NMOS version of the 6805.  The MUL instruction
  227.                         should also be avoided on all versions of the 6805
  228.                         except the C4.  Cycle times are for the NMOS
  229.                         versions.
  230.  
  231.            (ashc5) 68HC05:      Cycle times are for the 68HC05.  Otherwise, 
  232.                         this assembler is identical to as5.
  233.  
  234.            (as9) 6809:  The SETDP pseudo-op is not implemented.  Use the
  235.                         '>' and '<' operators to force the size of
  236.                         operands.
  237.  
  238.                         For compatibility, CPX is equal to CMPX.
  239.  
  240.            (as11) 68HC11:  Bit manipulation operands are separated by
  241.                         blanks instead of commas since the 'HC11 has bit
  242.                         manipulation instructions that operate on indexed
  243.                         addresses.
  244.  
  245.  
  246.           DETAILS
  247.                   Symbol:  A string of characters with an initial non-
  248.                         digit. The string of characters may be from the
  249.                         set:
  250.  
  251.                                   [a-z][A-Z]_.[0-9]$
  252.  
  253.                         ( . and _ count as non-digits ).  The `$' counts as
  254.                         a digit to avoid confusion with hexadecimal
  255.                         constants.  All characters of a symbol are
  256.                         significant, with upper and lower case characters
  257.                         being distinct.  The maximum number of characters
  258.                         in a symbol is currently set at 15.
  259.  
  260.                         The symbol table has room for at least 2000 symbols
  261.                         of length 8 characters or less.
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.                   Label:  A symbol starting in the first column is a label
  273.                         and may optionally be ended with a ':'.  A label
  274.                         may appear on a line by itself and is then
  275.                         interpreted as:
  276.  
  277.                                Label  EQU    *
  278.  
  279.                   Mnemonic:  A symbol preceded by at least one whitespace
  280.                         character. Upper case characters in this field are
  281.                         converted to lower case before being checked as a
  282.                         legal mnemonic.  Thus `nop', `NOP' and even `NoP'
  283.                         are recognized as the same mnemonic.
  284.  
  285.                         Note that register names that sometimes appear at
  286.                         the end of a mnemonic (e.g. nega or stu) must not
  287.                         be separated by any whitespace characters.  Thus
  288.                         `clra' means clear accumulator A, but that `clr a'
  289.                         means clear memory location `a'.
  290.  
  291.                   Operand:  Follows mnemonic, separated by at least one
  292.                         whitespace character.  The contents of the operand
  293.                         field is interpreted by each instruction.
  294.  
  295.                   Whitespace:  A blank or a tab
  296.  
  297.                   Comment:  Any text after all operands for a given
  298.                         mnemonic have been processed or, a line beginning
  299.                         with '*' or ';' up to the end of line or, an empty 
  300.                         line or, the remainder of a line after ';' (at 
  301.                         least one space or tab must precede the semicolon 
  302.                         if it is not the first character on the line)
  303.  
  304.  
  305.           FILES
  306.                   filename.S19  S-record output file
  307.                   STDOUT        listing and errors (use redirection for
  308.                                    listing file)
  309.                   Fwd_refs      Temporary file for forward references.
  310.  
  311.  
  312.           IMPLEMENTATION NOTES
  313.                   This is a classic 2-pass assembler.  Pass 1 establishes
  314.                   the  symbol table and pass 2 generates the code.
  315.  
  316.                                                           12/11/84 E.J.Rupp
  317.  
  318.  
  319.                   The ashc5 assembler was added in December, 1990.  Except 
  320.                   for providing 68HC05 cycle times, ashc5 is identical to 
  321.                   as5.
  322.  
  323.                   This version of the cross assemblers updated by Greg 
  324.                   Thoman in July, 1990 and includes the correction and 
  325.                   enhancements made by Bruce Olney.
  326.                   
  327.                   Previous version of the cross assemblers ported to the 
  328.                   IBM PC on 4/13/87.
  329.                   
  330.                   The "older versions" mentioned above were ported to the
  331.                   IBM PC on 7/25/85.
  332.